1. Field of the Invention
The present invention relates to a drive mechanism requiring accurate and precise operation, to control methods for the drive mechanism, and to programs for implementing the methods. More particularly, this invention relates to a control device, methods and programs for driving precisely and at high speed a drive mechanism, such as those used in modern electronic devices, corresponding control methods.
2. Description of the Related Art
Extremely high speed, precise operation is necessary in the drive mechanisms for many modern electronic devices. In printers, for example, this has meant using stepping motors or linear motors for driving the paper transport mechanism and carriage mechanism. In order to print the desired text or graphic in the correct position, it is also necessary to drive the print head (print operation) quickly and precisely according to the movement of the carriage and print medium (paper).
Conventional drive mechanism control technology includes CPU interrupt signal control methods and control methods using dedicated hardware. Fast, precise drive control of a print head drive mechanism by these conventional methods is further described below, by way of example, using drive control with a stepping motor (referred to as simply a “motor” below). Note that similar drive control is also needed for other mechanisms. The phase pattern of current applied to the motor at the phase change timing must be changed, and the amount of current flowing to the motor may also need to be changed, as part of motor drive control. Control during motor acceleration and deceleration is particularly complex because the phase change timing must be sequentially changed while at the same time sequentially changing the amount of current supplied to the motor according to the specific acceleration or deceleration conditions.
Control with dedicated hardware uses special dedicated hardware to control motor phase change and current supply. However, while using dedicated hardware offers the advantage of high precision drive control, the cost of providing such dedicated hardware is generally high. Other disadvantages of using dedicated hardware are longer development time and the inability to flexibly and easily change the control method.
In CPU-based interrupt control methods the CPU runs an interrupt process at a specific timing to read from memory control data for changing the phase pattern of current applied to the motor or controlling the amount of current flowing to the motor, and supply this control data to a drive controller. This method makes it possible to shorten product development time and flexibly change the control operation, while also helping to minimize development and product costs. CPU interrupt control methods are therefore widely used in the development of modern electronics because of their ability to shorten development time and accommodate fast changes in design requirements.
The CPU interrupt control process can ensure precise drive control according to the control data sent from the CPU as long as the drive device (“driver” below) is operating. However, various errors and problem factors can prevent the driver from operating according to the drive control data. In the carriage drive mechanism of a print head, for example, the carriage mechanism can be prevented from moving by an obstruction, such as a paper jam, in the carriage path. Under such circumstances changing the phase pattern or current supply from the controller will not cause the motor to turn because the carriage cannot move. When this happens the expected carriage position (that is, the position where the carriage should be or logical operating position) computed by the controller from the control data differs from the position where the carriage is actually present (the “current operating position”), and carriage drive cannot be precisely controlled.
An appropriate process must therefore be executed to handle such problems. In the print head carriage drive mechanism, for example, sensors regularly detect the actual carriage position to confirm if the carriage is being driven correctly. Operation is confirmed by CPU control causing the carriage to move regularly (such as every 6 seconds) to a specific sensor position (such as the home position) to detect the physical carriage position, compare this actual carriage position with the computed logical position, and detect any offset therebetween.
This position confirmation is also accomplished by a CPU interrupt process reading drive control data from memory to drive the motor and move the carriage to the home position. Drive control accuracy is confirmed from the logical carriage position computed from the control data, and the offset from the actual carriage position detected at the home position.
A conventional drive operation confirmation process using a CPU is described below with reference to FIG. 18. CPU 1 reads motor drive control data from a control data table stored to memory 2 at the phase change timing, and sends the control data to motor drive controller 24. The motor drive controller 24 drives motor driver 74 based on the control data, and thus causes motor 25 to turn. When the motor 25 turns, carriage 73 moves side to side through the carriage path by way of a power transfer mechanism 71. Simultaneously to sending the control data, CPU 1 computes the motor drive from the control data and determines from the computed motor drive the logical current position of carriage 73. A photosensor or other detector 72 is disposed at the home position in the path of carriage 73 movement. When the carriage 73 moves to the home position, detection circuit 75 detects the carriage presence. When the detection circuit 75 detects that the carriage 73 is in the home position, it sends an interrupt signal (home position (HP) detection signal in this case) to the CPU 1. When CPU 1 receives this interrupt signal it compares the logical carriage position with the home position to determine whether the carriage 73 is being driven normally. If the computed position is greatly offset from the carriage position at the home position, CPU 1 knows that carriage 73 drive is not normal and runs a particular error handling process. Motor drive control and position confirmation operations in the CPU 1 interrupt control process thus maintain accurate carriage movement.